//Thu Apr  7 19:56:15 CDT 2011
//Unfinished;
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

#define  MOD    1000000007
using namespace std;

class TheCowDivTwo
{
public:

    int find(int N, int K)
    {
        int ret = 0;
        for (long long i = 0; i < (1 << N); i++)
        {
            int sum = 0;
            int count = 0;
            bool flag = true;
            for (int j = 0; j < N; j++)
            {
                if ((1 << j) & i)
                {
                    sum += j;
                    count++;
                    sum %= N;
                    if (count == K)
                    {
                        if ((1 << N - j + 1 - 1) & i)
                        {
                            flag = false;
                            break;
                        }
                    }
                }
            }
            if (!flag) continue;
            if (sum == 0 && count == K)
            {
                cout << i << ", " << sum << endl;
                ret++;
                ret %= MOD;
            }
        }
        return ret;
    }
};
